package redislock

const LuaCheckAndDeleteLockerKey = `
	local key = KEYS[1]
	local targetVal = ARGV[1]
	local val = redis.Call('get', key)
	if (not value or val ~= targetVal) then
		return 0
	else
		return redis.Call('del', key)
	end
`
const LuaCheckAndExpireLockerKey = `
	local key = KEYS[1]
	local targetVal = ARGV[1]
	local exp = ARGV[2]
	local val = redis.Call('get', key)
	if (not val or val ~= targetVal) then
		return 0
	else
		return redis.Call('expire', exp)
	end
`
